﻿namespace star_questionnair.Utilities;

using System;
using System.Text;

public static class VerificationCodeGenerator
{
    private const string CodeChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    private const int CodeLength = 6;

    public static string GenerateCode()
    {
        var random = new Random();
        var sb = new StringBuilder(CodeLength);
        for (int i = 0; i < CodeLength; i++)
        {
            sb.Append(CodeChars[random.Next(CodeChars.Length)]);
        }
        return sb.ToString();
    }
}
